﻿using System.Text;

namespace JsiCommon.javaScriptInterop
{
    class JsiMemberAccess : IJsiExpression
    {
        private readonly IJsiExpression _o;
        private readonly string _memberName;

        public JsiMemberAccess(string memberName, IJsiExpression o)
        {
            _memberName = memberName;
            _o = o;
        }

        public void Compile(StringBuilder builder)
        {
            _o.Compile(builder);
            builder.Append('.').Append(_memberName);
        }
    }
}